<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ page import="com.zxz.news.entity.Manager" %>
<%
	Manager manager = (Manager)session.getAttribute("manager");
	if(manager!=null){
		if(!"".equals(manager.getUsername())){
			request.getRequestDispatcher("main.jsp").forward(request, response);
		}
	}
	String username = (String)request.getAttribute("username");
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>新闻发布系统后台登录</title>
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="<%=request.getContextPath() %>/css/bootstrap/bootstrap.min.css">

<!-- 可选的Bootstrap主题文件（一般不用引入） -->
<link rel="stylesheet" href="<%=request.getContextPath() %>/css/bootstrap/bootstrap-theme.min.css">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="<%=request.getContextPath() %>/js/bootstrap/jquery-1.12.3.min.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="<%=request.getContextPath() %>/js/bootstrap/bootstrap.min.js"></script>

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <!-- 全局样式 -->
    <!-- 登录页面样式 -->
    <link href="<%=request.getContextPath() %>/css/login/login.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript">
		//页面加载时执行方法
		$(function(){ 
			var username = "<%=username%>";
			if(username!='null'){
				$("#username").val(username);
			}
		}); 
	</script>
</head>
<body>
	<div class="clear-mp row main-login">
	  <div class=" clear-mp col-sm-12">
	    <h3>管理员登录</h3>
	    <form action="managerLogin.do" method="post" class="form-horizontal">
	    <div class="login-content row">
	      <div class="clear-mp col-sm-12">
	      	<label for="inputEmail3" class="control-label">用户名：</label>
	        <input type="text" class="login-info" id="username" placeholder="用户名" name="username" required="required">
	      	<span id="username_message" style="color: red;">${username_error}</span>
	      </div>
	      <div class="clear-mp login-oper col-sm-12">
	      	<label for="inputPassword3" class="control-label">密&nbsp;码：</label>
	        <input type="password" class="login-info" id="password" name ="password" placeholder="密码" required="required">
	      	<span id="pwd_message" style="color: red;">${pwd_error}</span>
	      </div>
	       <div class="col-sm-offset-4 clear-mp login-oper col-sm-9 checkbox">
	        <label>
	          <input type="checkbox" id="rememberName" name="记住用户名">记住用户名
	        </label>
	      </div>
	      <div class="form-group">
		      <div class="col-sm-offset-4 col-sm-9">
		         <button id="btn" type="submit" class="btn btn-default" onclick="show()">登录</button>
				 <button type="reset" class="btn btn-default">重置</button>
		      </div>
	      </div>
	    </div>
	    </form>
	  </div>
	</div>
</body>
</html>